package com.smarttiger.zero.admin.dao;

import com.smarttiger.zero.admin.entity.InterfaceArgsModel;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface InterfaceArgsDao extends BaseDao<InterfaceArgsModel> {

    @Query("select i from InterfaceArgsModel i where i.interfaceId = ?1 ORDER BY i.createDate")
    public List<InterfaceArgsModel> findAllByInterfaceId(String id);

    @Modifying
    @Query("delete from InterfaceArgsModel es where es.interfaceId = ?1")
    public void deleteByInterfaceId(String id);


}
